//
//  MyTabBarViewController.m
//  drug
//
//  Created by 沈鑫 on 16/4/5.
//  Copyright © 2016年 沈鑫. All rights reserved.
//

#import "MyTabBarViewController.h"
#import "HomePageViewController.h"
#import "PagingViewController.h"
#import "ConsultViewController.h"
#import "MyViewController.h"
#import "UMSocial.h"
#import "HomePageViewController.h"
@interface MyTabBarViewController ()<UITabBarControllerDelegate>

@end

@implementation MyTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    
 
    // 第一个界面
    HomePageViewController *homePage = [[HomePageViewController alloc]init];
    UINavigationController *homeNav = [[UINavigationController alloc]initWithRootViewController:homePage];
    homeNav.tabBarItem.title = @"首页";
    homeNav.tabBarItem.image = [UIImage imageNamed:@"tab_home_normal"];
  
    // 第二个界面
    PagingViewController *paging = [[PagingViewController alloc]init];
    UINavigationController *pagingNav = [[UINavigationController alloc]initWithRootViewController:paging];
    pagingNav.tabBarItem.title = @"分类";
    pagingNav.tabBarItem.image = [UIImage imageNamed:@"tab_category_normal"];
    
    // 第三个界面
    ConsultViewController *consult = [[ConsultViewController alloc]init];
    UINavigationController *consultNav = [[UINavigationController alloc]initWithRootViewController:consult];
    consultNav.tabBarItem.title = @"用药咨询";
    consultNav.tabBarItem.image = [UIImage imageNamed:@"tab_shoppingcart_normal"];
    
    // 第四个界面
    MyViewController *my = [[MyViewController alloc]init];
    UINavigationController *myNav = [[UINavigationController alloc]initWithRootViewController:my];
    myNav.tabBarItem.title = @"我的";
    myNav.tabBarItem.image = [UIImage imageNamed:@"tab_my_normal"];
    
    // 标签视图控制器
    self.viewControllers = @[homeNav, pagingNav, consultNav, myNav];
    
    self.delegate = self;
    
    // 一上来的界面
    self.selectedIndex = 0;
    
    // 背景颜色
    [self.tabBar setBarTintColor:[UIColor whiteColor]];
    
    // 点击颜色
    //self.tabBar.tintColor = [UIColor blackColor];
    
};

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
